<template>
  <el-row :gutter="10">
    <el-col :span="9">
      <dic-list @dicRowClick="dicRowClick" @dicUpdate="dicUpdate"></dic-list>
    </el-col>
    <el-col :span="15">
      <dic-item-list v-if="dicItemReflush"
                     :code="code"
                     :existItemCode="true"
                     :key="new Date().getDate()"></dic-item-list>
    </el-col>
  </el-row>
</template>

<script lang="ts" setup>
import DicItemList from "@/views/system/dic/DicItemList.vue";
import DicList from "@/views/system/dic/DicList.vue";
import {reactive, ref} from "vue";

const code = ref('');
const dicItemReflush = ref(true)

const flushDicItemList = () => {
  dicItemReflush.value = false;
  setTimeout(() => {
    dicItemReflush.value = true;
  }, 100);
}

const dicRowClick = (e: any) => {
  code.value = e.code;
  flushDicItemList();
}

/**
 * 
 * @param e 
 */
const dicUpdate = (e: any) =>{
  flushDicItemList();
}

</script>

<style scoped>

</style>